package com.ex.ui.infoframe;

import java.awt.EventQueue;

import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Color;

@SuppressWarnings("serial")
public class PersonInfoIFrame extends JInternalFrame {
	public  JLabel mNameLb;
	private JLabel mErrorCount;
	private JLabel mRightCount;
	private JLabel mQustionCount;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					PersonInfoIFrame frame = new PersonInfoIFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
	int mCounts = 0;
	int mRights = 0;
	int mErrors = 0;
	public void addQustion(boolean isright)
	{
		mCounts++;
		this.mQustionCount.setText("做题总数：" + mCounts);
		if (isright)
		{
			mRights++;
			this.mRightCount.setText("正确题数：" + mRights);
		}else
		{
			mErrors++;
			this.mErrorCount.setText("错误题数：" + mErrors);
		}
	}

	/**
	 * Create the frame.
	 */
	public PersonInfoIFrame() {
		setBounds(100, 100, 295, 263);
		getContentPane().setLayout(null); 
		mNameLb = new JLabel("个人信息");
		mNameLb.setBounds(14, 52, 72, 18);
		getContentPane().add(mNameLb); 
		
		 mQustionCount = new JLabel("做题总数：0");
		mQustionCount.setFont(new Font("微软雅黑", Font.BOLD, 17));
		mQustionCount.setBounds(24, 91, 227, 18);
		getContentPane().add(mQustionCount);
		
		 mErrorCount = new JLabel("错误总数：0");
		mErrorCount.setForeground(new Color(255, 0, 0));
		mErrorCount.setFont(new Font("微软雅黑", Font.BOLD, 17));
		mErrorCount.setBounds(24, 150, 227, 18);
		getContentPane().add(mErrorCount);
		
		 mRightCount = new JLabel("正确题数：0");
		mRightCount.setForeground(new Color(0, 128, 0));
		mRightCount.setFont(new Font("微软雅黑", Font.BOLD, 17));
		mRightCount.setBounds(24, 122, 227, 18);
		getContentPane().add(mRightCount);
	} 
}
